package com.plian.system.dao.bt.loginfo;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.dao.DaoSupport;
import com.plian.system.model.page.Page;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class LogInfoDao {

    @Resource(name = "daoSupport")
    private DaoSupport dao;

    /**
     * 新增
     *
     * @param pd
     * @throws Exception
     */
    public void save(PageData pd) throws Exception {
        dao.save("LogInfoMapper.save", pd);
    }
    

    /**
     * 列表
     *
     * @param page
     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    public List<PageData> list(Page page) throws Exception {
        return (List<PageData>) dao.findForList("LogInfoMapper.datalistPage", page);
    }


    /**
     * 通过id获取数据
     *
     * @param id
     * @throws Exception
     */
    public PageData findById(String id) throws Exception {
        return (PageData) dao.findForObject("LogInfoMapper.findById", id);
    }
}
